/*    */ package com.jcrj.util;
/*    */ 
/*    */ import java.sql.Connection;
/*    */ import java.sql.DriverManager;
/*    */ import java.sql.ResultSet;
/*    */ import java.sql.SQLException;
/*    */ import java.sql.Statement;
/*    */ 
/*    */ public class DBConnection
/*    */ {
/* 10 */   private static String driver = null;
/* 11 */   private static String url = null;
/* 12 */   private static String username = null;
/* 13 */   private static String password = null;
/*    */ 
/*    */   static {
/* 16 */     driver = DBConfig.getInstance().getProperty("mysql.driver");
/* 17 */     url = DBConfig.getInstance().getProperty("mysql.url");
/* 18 */     username = DBConfig.getInstance().getProperty("mysql.user");
/* 19 */     password = DBConfig.getInstance().getProperty("mysql.psw");
/*    */   }
/*    */ 
/*    */   public static Connection getConnection() throws Exception
/*    */   {
/* 24 */     Class.forName(driver);
/* 25 */     return DriverManager.getConnection(url, username, password);
/*    */   }
/*    */ 
/*    */   public static void closed(ResultSet rs, Statement st, Connection conn)
/*    */   {
/*    */     try {
/* 31 */       if (rs != null) rs.close();
/* 32 */       if (st != null) st.close();
/* 33 */       if (conn != null) conn.close(); 
/*    */     }
/*    */     catch (SQLException e) {
/* 35 */       e.printStackTrace();
/*    */     }
/*    */   }
/*    */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     com.jcrj.util.DBConnection
 * JD-Core Version:    0.6.0
 */